package com.newlink.building.userinfo.mvp

import com.newlink.building.common_base.base.BasePresenter
import com.newlink.building.common_base.ext.ss
import com.newlink.building.common_base.model.bean.FeedbackRequest
import com.newlink.building.userinfo.mvp.contract.Module_UserInfo_FeedbackContract
import com.newlink.building.userinfo.mvp.model.Module_UserInfo_FeedbackModel
import okhttp3.MultipartBody

/**
 * @author wangyang
 * @date 2022/9/20
 * @description 我的-关于页面的Presenter
 */
class Module_UserInfo_FeedbackPresenter : BasePresenter<Module_UserInfo_FeedbackContract.Model, Module_UserInfo_FeedbackContract.View>(),
    Module_UserInfo_FeedbackContract.Presenter {

    override fun createModel(): Module_UserInfo_FeedbackContract.Model = Module_UserInfo_FeedbackModel()

    override fun sendFeedBack(
        token: String,
        request: FeedbackRequest,
        parts: List<MultipartBody.Part>
    ) {
        mModel?.sendFeedBack(token, request, parts)?.ss(mModel, mView, true) {
            mView?.onSendFeedBackSuccess(it?.code == 200)
        }
    }
}